package com.neusoft.ysu.populationmanagement.controller;


import com.neusoft.ysu.populationmanagement.entity.CommonResult;
import com.neusoft.ysu.populationmanagement.entity.PoliceStation;
import com.neusoft.ysu.populationmanagement.service.IPoliceStationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author qym
 * @since 2025-06-13
 */
@RestController
@RequestMapping("/police-station")
@CrossOrigin
public class PoliceStationController {

    @Autowired
    private IPoliceStationService policeStationService;
    /**
     * @param policeStation
     * @return
     * @description 注册警局
     * @author zyk
     * @date 2025-06-16
     */
    @RequestMapping("registeredPoliceStation")
    public CommonResult registeredPoliceStation(PoliceStation policeStation){
        return policeStationService.registeredPoliceStation(policeStation);
    }

    /**
     * @param policeStation
     * @return CommonResult
     * @description 删除警局
     * @author zyk
     * @date 2025-06-16
     */
    @RequestMapping("deletePoliceStation")
    public CommonResult deletePoliceStation(PoliceStation policeStation){
        return policeStationService.deletePoliceStation(policeStation);
    }

    @RequestMapping("selectAllPolice")
    public CommonResult selectAllPolice(){
        return policeStationService.selectAllPolice();
    }



}
